package com.senlingspace.web.controller.weixin;

import com.senlingspace.common.core.domain.AjaxResult;
import com.senlingspace.system.service.impl.SysAreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 省市区联动
 *
 * @author lebronjames
 * @date 2024/09/09
 */
@Slf4j
@RestController
@RequestMapping("/wmp/area/v1")
public class MiniAppAreaController {

    @Autowired
    private SysAreaService sysAreaService;

    /**
     * 获取省市区树形结构
     */
    @PostMapping("/list")
    public AjaxResult getAreaTree() {
        String areas = sysAreaService.getMiniAppAreaTree();
        return AjaxResult.success("success", areas);
    }

}
